package com.shen.draw;

/**
 * Author:shen
 * CreateDate:2020/5/13.
 * Function:
 */
public class Circular implements Graphics{
    private static final double PI = 3.14;
    private double r;

    public Circular() {
    }

    public Circular(double r) {
        this.r = r;
    }

    public double getR() {
        return r;
    }

    public void setR(double r) {
        this.r = r;
    }

    @Override
    public double perimeter() {
        return r>0 ? r*2*PI:-1;
    }

    @Override
    public double area() {
        return r>0 ? r*r*PI:-1;
    }
}
